package tcu.iot.gasmanage.mapper;

import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;
import tcu.iot.gasmanage.entity.export.ExportDataReturn;
import tcu.iot.gasmanage.entity.export.ExportQuery;
import tcu.iot.gasmanage.mapper.provider.ExportProvider;

import java.util.List;

@Repository
@Mapper
@Component("ExportMapper")
public interface ExportMapper {

    @SelectProvider(type = ExportProvider.class, method = "SelectEquipmentData")
    @Results({@Result(property = "equipmentNumber",column = "equipmentNumber"),@Result(property = "equipmentName",column = "equipmentName"),@Result(property = "electricQuantity",column = "electricQuantity"),@Result(property = "signalStrength",column = "signalStrength"),
            @Result(property = "uploadFrequency",column = "uploadFrequency"),@Result(property = "province",column = "province"),@Result(property = "region",column = "region"),@Result(property = "site",column = "site"),
            @Result(property = "pipeline",column = "pipeline"),@Result(property = "principal",column = "principal")})
    List<ExportDataReturn> SelectEquipmentData(ExportQuery exportQuery);

    @SelectProvider(type = ExportProvider.class, method = "SelectEquipmentList")
    List<String> SelectEquipmentList(ExportQuery exportQuery);

    @SelectProvider(type = ExportProvider.class, method = "SelectEquipmentDataCount")
    int SelectEquipmentDataCount(ExportQuery exportQuery);

}
